package com.xros.demo.gamedataserver.domian.message;

import java.io.Serializable;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @Author: mzp
 * @Description: 自定义消息的父类
 * @Date: 2024/3/26 17:15
 * @Version: 1.0
 */
public abstract class CustomerMessage implements Serializable {


   //region 静态类属性

   protected static ConcurrentHashMap<Byte,Class<? extends CustomerMessage>> msgTypeContainer = new ConcurrentHashMap<>();


   static {
      CustomerMessage.msgTypeContainer.put((byte) 1,ChatMessage.class);
   }


   //endregion




   public abstract byte getMsgType();



   public  static Class<?> getMsgClzByType(byte msgType){

      return msgTypeContainer.getOrDefault(msgType,null);

   }

}
